﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GenericDelegateDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string, string> func;
            //1.使用委托来实现
            func = new Func<string, string>(Show);
            //2.使用匿名方法来实现
            func = delegate(string s) { return s + "ppppp"; };
            //3.使用lamada表达式来实现
            func = x => x + "ssss";


            Console.WriteLine(func("uuu"));
            Console.ReadLine();
        }

        static string Show(string input)
        {
            return "ssss" + input;
        }
    }
}
